Skip to content

boot: bootutil: loader: Fix issue with stuck revert - #2199

Merged
nordicjm merged 2 commits into
mcu-tools:mainfrom
nordicjm:fixstuckslot
Feb 12, 2025
Merged

nordicjm merged 2 commits into
mcu-tools:mainfrom
nordicjm:fixstuckslot

Conversation

@nordicjm

Copy link
Copy Markdown
Collaborator
Fixes an issue (only for swap using move, unsure if it affects
other modes) whereby a device can get into a state that there is
a valid primary image, no secondary image but the primary image
flag is still set to revert, which then makes loading a firmware
update from the application impossible due to it assuming that a
revert will happen upon device reboot

Fixes an issue (only for swap using move, unsure if it affects
other modes) whereby a device can get into a state that there is
a valid primary image, no secondary image but the primary image
flag is still set to revert, which then makes loading a firmware
update from the application impossible due to it assuming that a
revert will happen upon device reboot

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Adds a note on this fix

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
boot_swap_type_multi(BOOT_CURR_IMG(state)) == BOOT_SWAP_TYPE_REVERT) {
const struct flash_area *fap_pri;

rc = flash_area_open(flash_area_id_from_multi_image_slot(BOOT_CURR_IMG(state),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess that flash_area_id_from_multi_image_slot returning -1 never happens here.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be a very interesting flash setup heh

@nordicjm
nordicjm merged commit 251c054 into mcu-tools:main Feb 12, 2025
@nordicjm
nordicjm deleted the fixstuckslot branch September 23, 2025 11:00
neilberkman added a commit to neilberkman/mcuboot that referenced this pull request Mar 13, 2026
Add a post-merge CI workflow that builds MCUboot in one representative
swap-using-move configuration and runs a tardigrade fault-injection
sweep across the upgrade path. Catches regressions in the mcu-tools#2100/mcu-tools#2199
class where a power cut during swap leaves the device bricked or
booting the wrong image.

Signed-off-by: Neil Berkman <neil@xuku.com>
neilberkman added a commit to neilberkman/mcuboot that referenced this pull request Jul 17, 2026
Two tardigrade sweeps on nrf52840dk/nrf52840 with Zephyr pinned to
v3.7.0: power loss across the v1->v2 swap-move upgrade, and power loss
across the revert of a completed-but-unconfirmed upgrade, the failure
class of issue mcu-tools#1966 (PR mcu-tools#2100) and PR mcu-tools#2199.

The tardigrade action is pinned by full commit SHA; that revision pins
Renode to a versioned release archive verified by SHA-256 before
extraction, runs with strict profile validation, and resolves profile
assets only inside the caller workspace.  The platform description is
fetched from the same pinned revision.

Signed-off-by: Neil Berkman <neil@xuku.com>
neilberkman added a commit to neilberkman/mcuboot that referenced this pull request Jul 17, 2026
Two tardigrade sweeps on nrf52840dk/nrf52840 with Zephyr pinned to
v3.7.0: power loss across the v1->v2 swap-move upgrade, and power loss
across the revert of a completed-but-unconfirmed upgrade, the failure
class of issue mcu-tools#1966 (PR mcu-tools#2100) and PR mcu-tools#2199.

The tardigrade action is pinned by full commit SHA; that revision pins
Renode to a versioned release archive verified by SHA-256 before
extraction, runs with strict profile validation, and resolves profile
assets only inside the caller workspace.  The platform description is
fetched from the same pinned revision.

Signed-off-by: Neil Berkman <neil@xuku.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants